import 'package:car_map/mode/spuare_type_mode.dart';
import 'package:car_map/page/routers/fluro_navigator.dart';
import 'package:car_map/page/squarepage/square_router.dart';
import 'package:car_map/utils/image_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SpuareTypeItem extends StatelessWidget {
  final SpuareTypeModel spuareTypeModel;

  const SpuareTypeItem({Key key, this.spuareTypeModel}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return InkWell(
      onTap: () {
        switch (spuareTypeModel.currentIndex) {
          case 0:
            NavigatorUtils.push(context, SquareRouter.realNameQueryPage,
                replace: false);
            break;

          case 1:
            NavigatorUtils.push(context, SquareRouter.phoneInternetTimePage,
                replace: false);
            break;
          case 2:
            NavigatorUtils.push(context, SquareRouter.loanBlackListPage,
                replace: false);
            break;

          case 3:
            NavigatorUtils.push(context, SquareRouter.bankCardPage,
                replace: false);
            break;

          case 4:
            NavigatorUtils.push(context, SquareRouter.flowCardPage,
                replace: false);
            break;

          case 5:
            NavigatorUtils.push(context, SquareRouter.lostLetterBlackListPage,
                replace: false);
            break;

          case 6:
            NavigatorUtils.push(context, SquareRouter.enterPriseDataPage,
                replace: false);
            break;

          //加油站
          case 7:
            NavigatorUtils.push(context, SquareRouter.gasPage, replace: false);
            break;
          //停车场
          case 8:
            NavigatorUtils.push(context, SquareRouter.parkingLotPage,
                replace: false);
            break;
          //代价服务
          case 9:
            NavigatorUtils.push(context, SquareRouter.drivingPage,
                replace: false);
            break;

          //洗车服务
          case 10:
            NavigatorUtils.push(context, SquareRouter.carWashPage,
                replace: false);
            break;

          //4S店
          case 11:
            NavigatorUtils.push(context, SquareRouter.fourSPage,
                replace: false);
            break;

        //汽车服务
          case 12:
            NavigatorUtils.push(context, SquareRouter.carService,
                replace: false);
            break;

        //汽车维修
          case 13:
            NavigatorUtils.push(context, SquareRouter.repairPage,
                replace: false);
            break;

          //汽车凭租
          case 14:
            NavigatorUtils.push(context, SquareRouter.byrentCarPage,
                replace: false);
            break;
            //美食
          case 15:
            NavigatorUtils.push(context, SquareRouter.foodPage,
                replace: false);
            break;

          //景点
          case 16:
            NavigatorUtils.push(context, SquareRouter.attractionsPage,
                replace: false);

            break;

        //药店
          case 20:
            NavigatorUtils.push(context, SquareRouter.pharmacyPage,
                replace: false);
            break;

          //咖啡店
          case 21:
            NavigatorUtils.push(context, SquareRouter.coffeeShopPage,
                replace: false);
            break;

          //医院
          case 22:
            NavigatorUtils.push(context, SquareRouter.hospitalPage,
                replace: false);
            break;
        }
      },
      child: Container(
        decoration: BoxDecoration(
            color: Colors.white,
            border: Border(
              bottom: BorderSide(color: Colors.black12, width: 0.5),
              right: BorderSide(color: Colors.black12, width: 0.5),
            )),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Image.asset(
              ImageUtils.getImgPath(spuareTypeModel.urlPath),
              width: ScreenUtil().setWidth(60.0),
              height: ScreenUtil().setHeight(60.0),
            ),
            Container(
              padding: EdgeInsets.all(5.0),
              child: Text(
                spuareTypeModel.title,
                style: TextStyle(fontSize: ScreenUtil().setSp(20.0)),
              ),
            )
          ],
        ),
      ),
    );
  }
}
